<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

/**
 * App\MidAutumnLog
 *
 * @property-read \App\User $user
 * @mixin \Eloquent
 */
class MidAutumnLog extends Model
{
    protected $table = 'mid_autumn_log';
    public $timestamps = false;

    public function user()
    {
        return $this->belongsTo(User::class, 'user_id', 'c_id');
    }

    const PRIZE_YES = 1;
    const PRIZE_NO = 2;

    const TYPE_NONE = 0;
    const TYPE_IPHONE = 1;
    const TYPE_LAMP = 2;
    const TYPE_HEADSET = 3;
    const TYPE_REDBAG1 = 4;
    const TYPE_REDBAG2 = 5;

    static $TypeDisplay = [
        self::TYPE_NONE => '未中奖',
        self::TYPE_IPHONE => 'iPhoneX',
        self::TYPE_LAMP => '灯',
        self::TYPE_HEADSET => '耳机',
        self::TYPE_REDBAG1 => '红包',
        self::TYPE_REDBAG2 => '红包',
    ];

}
